﻿using Leo.Common.Logger;
using Microsoft.AspNetCore.Diagnostics;
using System.Diagnostics;
using System.Text.Json;

namespace JwtAuth
{
    public class GlobalExceptionHandler : IExceptionHandler
    {
        private readonly ILogs logs;

        public GlobalExceptionHandler(ILogs logs)
        {
            this.logs = logs;
        }

        public ValueTask<bool> TryHandleAsync(HttpContext context, Exception exception, CancellationToken cancellationToken)
        {

            var traceId = Activity.Current?.Id ?? context.TraceIdentifier;
            var route = context.Request.Path + context.Request.QueryString;

            var headers = JsonSerializer.Serialize(context.Request.Headers);

            string body = string.Empty;





            throw new NotImplementedException();
        }
    }
}
